import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
public class TelFee {
    public String fee(String sd1,String sd2,String st,String sa) {

        double telFee;
            HoldingTime ht = new HoldingTime(sd1,sd2,st,sa);

            DecimalFormat    df   = new DecimalFormat("######0.00");
            long minute = ht.getHoldingTime();
            //计算话费
            if(minute == 0){
                return "错误";
            }
            else if(minute <= 20){
                telFee = 0.05*minute;
            }else{
                telFee = 1.00 + (minute - 20)*0.1;
            }
            return df.format(telFee);
    }
}
